package com.douqu.game.main.util;


import com.bean.core.buffer.ByteBuffer;
import com.bean.core.util.MD5Utils;
import com.douqu.game.core.entity.WorldInfo;
import com.douqu.game.core.entity.ext.BagInfo;
import com.douqu.game.core.entity.sprite.Player;
import com.douqu.game.core.util.EntityUtils;
import com.douqu.game.main.server.LoadManager;

import java.text.MessageFormat;

/**
* Author : Bean
* 2017-07-06 15:29
*/

public class Test {

    public static void main(String[] args) {

//        testLoad();

//        testGrade();
//
//        testCreateEntity();

//        String result = MD5Utils.encodeLowercase("douqu1480893362");
//        System.out.println(result);


    }

    public static void testLoad()
    {
        LoadManager.load();

        BagInfo bagInfo = new BagInfo(null,new WorldInfo());
        bagInfo.init();

        ByteBuffer buffer = new ByteBuffer();
        bagInfo.writeTo(buffer);

        bagInfo.loadFrom(buffer);
    }

    public static void testGrade()
    {
        Player player = new Player(null);
        System.out.println("添加星星前的段位:" + player.grade + "  星星:" + player.star);

        player.addStar(10);
        player.addStar(3);

        System.out.println("添加星星后的段位:" + player.grade + "  星星:" + player.star);

//        player.addStar(-10);

//        System.out.println("添加星星后的段位:" + player.grade + "  星星:" + player.star);
    }


    public static void testCreateEntity()
    {
        EntityUtils.createEntity("D:/soldier", "D:/", "Soldier");
    }


}
